package com.weiyuwqj.server.service.picture.impl;

import com.github.pagehelper.PageHelper;
import com.weiyuwqj.api.service.SysPictureTypeService;
import com.weiyuwqj.server.service.base.BaseServiceImpl;
import com.weiyuwqj.api.common.PageList;
import com.weiyuwqj.api.common.Paginator;
import com.weiyuwqj.server.mapper.SysPictureTypeMapper;
import com.weiyuwqj.api.model.SysPictureType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2015/12/7.
 */
@Service("pictureTypeService")
public class SysPictureTypeServiceImpl extends BaseServiceImpl<SysPictureType> implements SysPictureTypeService{
    @Autowired
    SysPictureTypeMapper sysPictureTypeMapper;

    @Override
    public PageList getList(Paginator p, Map<String, Object> param) {
        PageHelper.startPage(p.getPageNum(), p.getPageSize());
        List<SysPictureType> list = sysPictureTypeMapper.getList(param);
        return new PageList(list);

    }

    @Override
    public SysPictureType getSingle(Integer id) {
        return sysPictureTypeMapper.getSingle(id);
    }
}
